package com.hns.frame.security;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.security.core.Authentication;
import org.springframework.security.web.authentication.AuthenticationSuccessHandler;

import com.hns.can.common.domain.ReturnResult;
import com.hns.frame.util.ResponseUtil;

/**
 * 手机端登录验证通过处理
 * @author:Fisher
 * @email:zhuangcaijin@126.com
 * @version Revision 2.0.0
 */
public class PhoneAuthenticationSuccessHandler implements AuthenticationSuccessHandler {  
    
    public PhoneAuthenticationSuccessHandler() {  
    }  
  
    /**
     * 登录成功处理
     * @param request
     * @param response
     * @param authentication
     * @throws IOException
     * @throws ServletException
     * @see org.springframework.security.web.authentication.AuthenticationSuccessHandler#onAuthenticationSuccess(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, org.springframework.security.core.Authentication)
     * @author:Fisher
     * @email:zhuangcaijin@126.com
     */
    public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response,  
            Authentication authentication) throws IOException, ServletException {  
        
        ReturnResult result = new ReturnResult();
        ResponseUtil.responseJSON(result, response);
    }  
} 
